package com.huawei.smartcity0102.util;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.PopupWindow;

/**
 * @author ZengYunyi
 * @description:
 * @date :2022/1/2 14:03
 */
public class Pp {
    private PopupWindow p;
    public View getP(Context c,int layId){
        View v= LayoutInflater.from(c).inflate(layId,null);
        p=new PopupWindow(v);
        p.setWidth(c.getResources().getDisplayMetrics().widthPixels);
        p.setHeight(c.getResources().getDisplayMetrics().heightPixels);
        p.setFocusable(true);
        p.showAtLocation(v, Gravity.TOP,0,0);
        return v;
    }
    public void cp(){
        if(p!=null){
            p.dismiss();
        }
    }
}
